/****** Object:  View [dbo].[Vendas]    Script Date: 02/23/2010 23:37:46 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO


CREATE VIEW [dbo].[V_ZecaFil_Intervencoes]
AS
select	t.Nome as Tecnico,
        ii.CDU_IdItem as IdItem,
        ii.CDU_Data as Data,
        ts.CDU_Descricao as TipoServico,
        c.Nome as Cliente,                            
        ii.CDU_Contacto as Contacto, 
        ii.CDU_Localidade as Localidade, 
        ii.CDU_Executado as Executado, 
        ii.CDU_Reclamacao as Reclamacao, 
        ii.CDU_Factura as Factura, 
        ii.CDU_Valor as Valor,
		ii.CDU_Notas as Notas              
from	TDU_Intervencao i, Tecnicos t, TDU_ItemIntervencao ii, Clientes c, TDU_TiposServico ts
where   ii.CDU_Id = i.CDU_Id
		and t.Tecnico = i.CDU_Tecnico
        and c.Cliente = ii.CDU_Cliente
        and ts.CDU_Codigo = ii.CDU_TipoServico

GO